package lucene.server.web.model;

import lombok.Data;
import lucene.server.core.model.IndexConfig;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Data
public class AnalyseInfo {
    private String cpu;
    private String memory;
    private Map<String,Integer> docs = new HashMap<>();
    private List<IndexConfig> index;
    private List<Map<String,Object>> tasks = new java.util.ArrayList<>();
    private List<Map<String,Object>> conns = new java.util.ArrayList<>();
    private Map<String,Object> files = new HashMap<>();
    private Long docCount = 0L;
    private Long lastUpdate = 0L;
    public void setIndexDocNum(String indexName,int docCount) {
        docs.put(indexName,docCount);
        this.docCount += docCount;
    }
    public void newAnalyse(){
        docCount = 0L;
        docs.clear();
        tasks.clear();
        conns.clear();
        files.clear();
    }
}
